<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.mytrip.model.*" import="java.util.*" import="java.text.SimpleDateFormat" import="com.mytrip.util.SpringUtil" import="com.mytrip.service.*" %>
    <div id="main_right">
     
        <div class="GTbox">
      <div class="GTtitle"> <a href="">
          <h3>推荐关注</h3>
          </a>
          <div class="TR"><a href="">更多>></a></div>
        </div>
        <div class="content">
        <ul class="PL_list">
            <li><a href="" class="ui_avatar"><img src="images/plofile.gif" /></a><a href="" class="textoverflow">小豆妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/pp.jpg" /></a><a href="" class="textoverflow">可可在线</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p2.gif" /></a><a href="" class="textoverflow">plyer</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p3.gif" /></a><a href="" class="textoverflow">妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p4.gif" /></a><a href="" class="textoverflow">小豆爱妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p5.gif" /></a><a href="" class="textoverflow">小豆爱妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p3.gif" /></a><a href="" class="textoverflow">小豆爱妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p2.gif" /></a><a href="" class="textoverflow">小豆爱妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
            <li><a href="" class="ui_avatar"><img src="images/p5.gif" /></a><a href="" class="textoverflow">小豆爱妈妈</a><br /><a class="gu"><img src="images/addpl.gif" border="0" /> 关注他</a></li>
          </ul>
          </div>
       </div>
      <div class="GTbox">
        <div class="GTtitle">
          <h3>旅行地图</h3>
          <div class="TR"></div>
        </div>
        <div style="width:300px;height:300px;" id="right_map"></div></div>
        
        <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
        <script type="text/javascript">
        window.addEvent('domready', function() {
		    var map = new BMap.Map("right_map");            // 创建Map实例
			var point = new BMap.Point(105.136499,37.391368);    // 创建点坐标
			map.centerAndZoom(point,4);                     // 初始化地图,设置中心点坐标和地图级别。
			
			<%
			List<City> tripCityList = (List<City>)((TripManager)SpringUtil.getBean("tripManager")).queryTripCitys();
			for(City city : tripCityList){
				if(city.getLat()!=null && city.getLon()!=null){
			%>
			map.addOverlay(new BMap.Marker(new BMap.Point(<%=city.getLon()%>,<%=city.getLat()%>)));              // 将标注添加到地图中
			<%
				}
			}
			%>
		});
		</script>
       <div class="GTbox">
        <div class="GTtitle">
          <h3>网站动态</h3>
          <div class="TR"><a href="<%=request.getContextPath() %>/front/news!list.action">更多&gt;&gt;</a></div>
        </div>
        <div class="content">
          <ul class="news">
          <%
          	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
          	List<News> newsList = (List<News>)((NewsManager)SpringUtil.getBean("newsManager")).queryNews(0, 6);
          	for(News news : newsList){
          		Integer id = news.getId();
          		String title = news.getTitle();
          		String publishTimeStr = sdf.format(news.getPublishTime());
          %>
            <li><a href="<%=request.getContextPath() %>/front/news!detail.action?id=<%=id%>"><%=title%></a><%=publishTimeStr%></li>
          <%
          	}
          %>
          </ul>
        </div>
      </div>
     
      <div class="ad"><a href=""><img src="<%=request.getContextPath() %>/front/images/ad2.jpg" /></a></div>
    </div>
